﻿Photoshop:
;定义注释
    vim.SetAction("<Photoshop_NormalMode>", "返回正常模式")
    vim.SetAction("<Photoshop_InsertMode>", "进入VIM模式")
    vim.SetWin("Photoshop", "AE_CApplication_15.0")

;normal模式（必需）
    vim.SetMode("normal", "Photoshop")
    vim.map("<insert>","<Photoshop_InsertMode>","Photoshop")
;vim.comment("<Phantom_切换到【VIM模式】>","按下Esc键可以切换为VIM模式")

;insert模式
    vim.SetMode("insert", "Photoshop")
    vim.Map("<esc>", "<Photoshop_NormalMode>", "Photoshop")
    vim.Map("<F5>", "<Photoshop_渲染输出>", "Photoshop")
    vim.Map("<F6>", "<Photoshop_QuickMenu>", "Photoshop")
    vim.Map("<F8>", "<Photoshop_我的工具>", "Photoshop")
    vim.Map("X", "<Photoshop_Close>", "Photoshop")
return
; 对符合条件的控件使用insert模式，而不是normal模式
Photoshop_CheckMode()
{
    ControlGetFocus, ctrl, AHK_CLASS AE_CApplication_15.0
    ; msgbox, ctrl
    if RegExMatch(ctrl, "Edit2")
        return true
    return false
}

;【全局运行AE】
<RunPhotoshop>:
    PhotoshopPath := ini.BOBOPath_Config.PhotoshopPath
    Photoshop_Class := ini.ahk_class_Config.Photoshop_Class
    DetectHiddenWindows, on
    IfWinNotExist PhotoshopPath Photoshop_Class 
    { 
   		Run %PhotoshopPath%
    	WinActivate 
    } 
    	Else IfWinNotActive ahk_class Photoshop_Class 
    { 
    	WinActivate
    } 
    Else 
    { 
        WinMinimize 
    } 
 Return

<Photoshop_NormalMode>:
;   send,{esc}
    vim.SetMode("normal", "Photoshop")
    MsgBox, 0, 提示, 【正常模式】, 0.5
return

<Photoshop_InsertMode>:
;   send,{esc}
    vim.SetMode("insert", "Photoshop")
    MsgBox, 0, 提示, 【VIM模式】, 0.5
return

<Photoshop_渲染输出>:
    send, ^m
Return

<Photoshop_QuickMenu>:
    send, ^!6
return

<Photoshop_Close>:
    send, !{F4}
return

<Photoshop_我的工具>:
    send, ^!7
return